# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=typing
pkgbase=mingw-w64-python2-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}")
pkgver=3.6.6
pkgrel=1
pkgdesc='Backport of the standard library typing module to Python versions older than 3.6 (mingw-w64)'
url='https://pypi.python.org/pypi/typing'
license=('FSF')
arch=('any')
makedepends=("${MINGW_PACKAGE_PREFIX}-python2"
             "${MINGW_PACKAGE_PREFIX}-python2-setuptools")
depends=("${MINGW_PACKAGE_PREFIX}-python2")
source=("https://files.pythonhosted.org/packages/bf/9b/2bf84e841575b633d8d91ad923e198a415e3901f228715524689495b4317/${_realname}-${pkgver}.tar.gz")
sha256sums=('4027c5f6127a6267a435201981ba156de91ad0d1d98e9ddc2aa173453453492d')

prepare() {
  cd ${srcdir}
  cp -r ${_realname}-${pkgver} build-python2
}

build() {
  cd ${srcdir}/build-python2
  ${MINGW_PREFIX}/bin/python2 setup.py build
}

package() {
  cd ${srcdir}/build-python2
  MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
  ${MINGW_PREFIX}/bin/python2 setup.py install --prefix=${MINGW_PREFIX} --root="${pkgdir}"
}
